<!DOCTYPE html>
<head>
    <title>genact 0.3.2</title>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=1" name="viewport" />
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/xterm@3.0.1/dist/xterm.css" />
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/normalize-css@2.3.1/normalize.css" />
    <link rel="shortcut icon" type="image/png" href="https://assets-cdn.github.com/images/icons/emoji/unicode/1f300.png"/>
    <link rel="stylesheet" href="styles.css" />
    <script src="https://cdn.jsdelivr.net/npm/xterm@3.0.1/dist/xterm.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/xterm@3.0.1/dist/addons/fit/fit.js"></script>
</head>
<body>
    <div id="terminal"></div>
    <script type='text/javascript'>
        var term = new Terminal({
            scrollback: 0
        });
        window.term = term;
        term.open(document.getElementById('terminal'));
        var Module = {
            print: (text) => {
               term.writeln(text);
               console.log(text);
            },
            printErr: (text) => {
                term.writeln("JS/WASM ERROR: " + text);
                console.log(text);
            },
            setStatus: (text) => {
                console.log(text);
            }
        };
        Module.setStatus('Loading...');
        term.writeln("Loading...");
        window.onresize = () => {
            fit(term);
        }
        fit(term);
    </script>
    <script src="genact.js"></script>
</body>
</html>
